import request from '@/common/utils/request'

/**
 * 手机号登录
 * @returns
 */
export const getUserPhoneApi = (mobile: string, password: string) => {
  return request({
    url: '/sys/login',
    method: 'POST',
    data: { mobile, password },
  })
}

/**
 * 获取加密串-用来生成二维码
 * @returns
 */
export const getUserQrcodeKeyApi = () => {
  return request({
    url: '/sys/qrcodeKey',
    method: 'GET',
  })
}

/**
 * 获取加密的状态
 * @returns
 */
export const checkQrCodeStatusApi = () => {
  return request({
    url: '/sys/qrcodeState',
    method: 'GET',
  })
}

/**
 * 修改用户密码
 * @returns
 */
export const putSysUserUpdatePassApi = (data) => {
  return request({
    url: '/sys/user/updatePass',
    method: 'PUT',
    data
  })
}

/**
 * 更新用户头像
 * @returns
 */

export const putSysUpdateStaffPhotoApi = (data) => {
  return request({
    url: '/sys/updateStaffPhoto',
    method: 'PUT',
    data
  })
}